#include "stdafx.h"
#include <iostream>
#include "bst.h"
#include "mergesort.h"
#include "qksort.h"
#include "htable.h"
#include "kmp.h"
#include "doublearray.h"
#include "linkedlist.h"
#include "maxsubarray.h"

using namespace std;

double findsqrt( double t ){
	static const double ERROR = 0.000000001;
	double low = 0;
	double high = t;
	while ( (high-low) > ERROR ){
		double mid = ( low + high ) / 2.0;
		if ( (mid*mid) > t ){
			high = mid;
		}else{
			low = mid;
		}
	}
	return low;
}

int getit(char* a){
	if (a==NULL) return 0;
	char tmp=*a;
	int c=0;
	int mx=c;
	for (int i=0;i<strlen(a);++i){
		if (tmp==* (a+i)){
			++c;
		}else{
			tmp=*(a+i);
			mx= max(mx,c);
		}
	}
	return mx;
}


int _tmain(int argc, _TCHAR* argv[]){
	test_maxsubarray_oo();
	test_BST();
	//testmedian();
	/*string k="ababaa";
	//int* p=new int[k.size()];
	int p[50]={-1};
	KMP::getfailurefunction(k,p);
	KMP::getfailurefunction("ababaca",p);
	cout << KMP::searchstring1("abababaab","ababaa") << endl;
	test_sort();*/

	getit("111asdfas");

	llist2 a;
	a.push_front(10);
	a.push_front(11);
	a.push_front(12);

	return 0;
}